The present disclosure relates to data processing. More particularly, it relates to caching data for data processing.
A cache may be provided in a data processing apparatus in order to store local copies of data items which are stored in memory, such that When those data items are frequently accessed by the data processing apparatus the latency associated with retrieving those data items from memoir need not be incurred for each access.
Caches may be provided in a number of cache levels, wherein the cache levels and the memory in which the data items are stored form a hierarchy, with smaller, faster caches being provided closer to the processing element of the data processing apparatus and larger, slower caches being provided closer to the memory.
Caches may be arranged in a set-associative manner, wherein multiple ways are provided in which data items can be stored. The storage location of a given data item in the cache is usually determined by a portion of the memory address of that data item, but the multiple ways provide a corresponding number of possible storage locations for the data item. This mitigates against problems associated with two data items, which are both frequently accessed by the data processing apparatus, having the same memory address portion and therefore the same storage location in the cache. If there were only one possible storage location for these two data items in the cache, then accessing one would evict the other. and the frequent access made to both would result in “thrashing”.
The speed and efficiency of operation of a cache are important factors in the implementation of a cache in a data processing apparatus and there remains the opportunity for improvement in both these characteristics.